<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>v-model修饰符</title>
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id ="app"> 
    <!-- 1.修饰符：lazy -->
    <br>
    姓名：<input type="text" v-model.lazy = "lazyMessage">
    <br>
    &nbsp;&nbsp; <b>说明：</b> v-model.lazy失去焦点或回车才绑定数据，不是实时绑定
    <h2>lazy数据值：{{lazyMessage}}</h2>

    <br>
    <br>
    <br>

    <!-- 2.修饰符：number -->
    年龄：<input type="number" v-model.number="numAge">
    <h2>年龄数据类型：{{numAge}}-{{ typeof numAge}}</h2>

    <br>
    <br>
    <br>

    <!-- 3.修饰符：trim 去除首尾空格-->
    备注：<input type="text" v-model.trim="remark">

  </div>

  <script>
   var vm = new Vue({
    el: '#app',
    data: {
      lazyMessage: 'lazy',
      numAge: '0',
      remark: ''
    },
    methods: {}
   });
  </script>
</body>

</html>